package com.wwg.market.ui.category.client;

import com.mobileares.midp.widgets.client.page.ItemModel;
import com.mobileares.midp.widgets.client.page.MenuBuilder;
import com.mobileares.midp.widgets.client.page.MenuModel;
import com.mobileares.midp.widgets.client.page.PageModel;
import com.nexustar.gwt.widgets.client.asyn.LoadingAsyncCallback;
import com.wwfish.gwt.model.client.ILoadModelProvider;
import com.wwfish.gwt.model.client.IModelCallback;
import com.wwfish.gwt.model.client.impl.FishModelManager;
import com.wwg.market.ui.dashboard.client.Utils;
import com.wwg.market.ui.service.interfaces.CategoryService;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-11-22
 * Time: 18:15:29
 * To change this template use File | Settings | File Templates.
 */
public class MenuImpl implements MenuBuilder {
    public static  String categoryPropertyType= "categoryPropertyType";

    public List<MenuModel> getMenu() {
          List<MenuModel> result = new ArrayList<MenuModel>();
        MenuModel menu = new MenuModel("应用管理",MenuImpl.class.getName());
        menu.setPages(getPageModels(menu));
        result.add(menu);
//        menu.addCacheCallBack(new ItemModel.CacheDateCallBack() {
//            public void process() {
//            }
//        });
//        
        return result;
    }
      private List getPageModels(MenuModel menu) {
        PageModel page = new PageModel();
        page.setMenuModel(menu);
        page.setPageId("page");
        page.setPageTitle("商品管理");

        List r = new ArrayList();
        PageModel page1 = new PageModel();
        page1.setMenuModel(menu);
        page1.setPageId(CategoryManagerPage.class.getName());
        page1.setPageTitle("商品分类管理");
//        PageModel page2 = new PageModel();
//        page2.setMenuModel(menu);
//        page2.setPageId("page"+2);
//        page2.setPageTitle("产品属性维护");

        r.add(page1);
//        r.add(page2);

        List result = new ArrayList();
        page.setChildren(r);
        result.add(page);
        return result;
    }
   
}
